#include<stdio.h>
#include<signal.h>

volatile int g_flag = 0;
void changeflag(int signo)
{
    (void)signo;
    g_flag =1;
    printf("将g_flag由%d->%d\n",g_flag,1);
}
int main()
{

    signal(2,changeflag);
    while(!g_flag); // 故意死循环
    printf("process quit \n");
    return 0;
}